package tjs.study.notes.alibaba.user.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import tjs.study.notes.alibaba.user.service.UserServiceA;

/**
 * Created by Nicky.Tang on 2022/1/2 4:21 下午
 *
 * @since 02.12.10
 */
@RestController
@RefreshScope
//@RequestMapping("/user")
public class UserControllerAli {
    @Autowired
    private UserServiceA userService;
    @Value("${test.nacos.user}")
    private String tnc;

    @GetMapping("/testNacos")
    public String testNacos() {
        return tnc;
    }

    @GetMapping("/buy/{userId}")
    public String buy(@PathVariable("userId")String userId) {
        return userService.buy(userId);
    }
}
